<%@page import="com.stu.utils.PageBean"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
  <head>
  
    <meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>极客之家-博客管理</title>
	
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
    
    <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->

	<!-- 分页 -->
	<link rel="stylesheet" href="<%=path%>/css/bootstrap-combined.css">

	<link rel="stylesheet" href="<%=path%>/css/info_list.css">

  </head>
  
  <body> 
    <!-- top start -->
    <jsp:include page="top.jsp"></jsp:include>
    <!-- top end -->
   
	 <div class="container-fluid divBlock">
		
		
		
	
		<div class="row cotainer  infoTable">
			<table class="table table-striped table-bordered">
				<caption class="text-center">
					<header class="toCenter">
						<h1>
							<small> Blogs</small>
						</h1>
						<hr style="width: 100%;">
					</header>
					<div class="">  
						<input type="text" name="" id="my_blog_list_search_input" class="admin_news_search_input"  placeholder="博客标题">
						<button  id="my_blog_list_search_btn" class="btn btn-info info_list_search_btn">查询博客</button>
						<a href="<%=path%>/pages/writeblog.jsp"><button  id="my_blog_list_search_new" class="btn btn-info ">新建博客</button></a>
					</div>
				</caption>
				<thead>
						<tr>
						<td class="  " style="text-align:center;"> 
							<input type="checkbox" id="checkAllMyBlogs" value="">
							<button class="btn btn-warning" id="my_blog_list_delAll_btn">删除</button>
						</td>
						<td class="  " style="text-align:center;">标题</td>
						<td class="  " style="text-align:center;">时间</td>
						<td class="  " style="text-align:center;">操作</td>
					</tr>
				</thead>
				<tbody id="my_blog_list_tbody">

						<!-- <tr> 
							<td class="">
								<input type="checkbox" name="abc" value="">
							</td>
							<td class="">1
							</td>
							<td class="">
								<a href="#">查看</a>|
								<a href="#">编辑</a>|
								<a href="#">删除</a>
							</td>
						</tr> -->
 

				</tbody>
				

			</table>
		</div>
	</div>
    
    
    <!-- js start -->
	<script type="text/javascript" src="<%=path %>/js/my_blog_list.js"></script>
	
	<script type="text/javascript">  
		$(function() {
			 
			var path='<%=path%>';
			 
			refreshMyBlogsTable(path,1);
			
			/* 点击新闻删除  */
			$("#my_blog_list_delAll_btn").click(function(){
				var ids=getChecked();
				if(ids.length>0){ 
					$.ajax({ 
						type:"POST",   
						url:path+"/blog_deleteBlogsByIds.action",
						data:{ 
							ids:ids, 
						},
						dataType:"json",
						success:function(result){
							if(result.success){
								alertSuccess("删除数据成功");
								refreshMyBlogsTable(path,1); 
							}else{
								alertError("删除数据失败");
							}
						}
					});
				}else{
					alertError("请选中删除项");
				}
			})
			
			/* 点击查询  */
			$("#my_blog_list_search_btn").click(function(){
				refreshMyBlogsTable(path,1);
				return false;/* 防止刷新整个页面  */
			})
			
			/* 全选/取消选中  */
			$("#checkAllMyBlogs").bind("click", function() {
				if (this.checked) {
					$("input[type=checkbox]").prop("checked", 'true');
				} else {
					$("input[type=checkbox]").removeAttr("checked");
				}
			});
			
		});
	</script>
	<!--  js end -->
    
  </body>
</html>